import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XhljVenuesForm, XhljVenuesQuery, XhljVenuesVo } from '@/api/xhlj/model/venuesModel';
import { request } from '@/utils/request';

// 查询大会会场列表
export function listVenues(query?: XhljVenuesQuery) {
  return request.get<TableDataInfo<XhljVenuesVo>>({
    url: '/xhlj/venues/list',
    params: query,
  });
}

// 查询大会会场详细
export function getVenues(venuesId: number) {
  return request.get<R<XhljVenuesVo>>({
    url: `/xhlj/venues/${venuesId}`,
  });
}

// 新增大会会场
export function addVenues(data: XhljVenuesForm) {
  return request.post<R<void>>({
    url: '/xhlj/venues',
    data,
  });
}

// 修改大会会场
export function updateVenues(data: XhljVenuesForm) {
  return request.put<R<void>>({
    url: '/xhlj/venues',
    data,
  });
}

// 删除大会会场
export function delVenues(venuesIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xhlj/venues/${venuesIds}`,
  });
}
